<?php 
 require_once('nav.php');
require_once('inc_admin.php');
connect();
$search=$_GET['search'];

$sql="select * from flower where lyj_title like '%{$search}%' ";
$re=mysql_query($sql) or die('查询失败！'.mysql_error());

 ?>
   <center><h3>鲜花列表</h3></center>
   <table class="table table-hover">
   <thead>
   	<tr>
     <th>编号</th>
     <th>鲜花标题</th>   
     <th>鲜花产地</th>
     <th>鲜花简介</th>
     <th>添加时间</th>
     <th>点击量</th>
   </tr>
   </thead>

   <tbody>
   <?php
    while($row=mysql_fetch_assoc($re) ){
     echo '<tr>';
     echo '<td>'.$row['lyj_id'].'</td>';
     echo '<td>'.'<a href="detail.php?id='.$row['lyj_id'].'">'.$row['lyj_title'].'</a>'.'</td>';  
     echo '<td>'.$row['lyj_place'].'</td>';  
     echo '<td>'.$row['lyj_intro'].'</td>';  
     echo '<td>'.$row['lyj_adddate'].'</td>';  
     echo '<td>'.$row['lyj_hint'].'</td>';
     echo '</tr>';  
    }
    echo '</tbody>';
    echo '</table>';  
    $totalrows = count($row);
    echo "<table align='center'><tr><td>共有{$totalrows}条记录</td></tr></table>"   ;
   ?>